package com.wjk.kylin.mall.common.core.exception;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class BaseError {

    private int code;
    private String msg;

    /**默认错误码的构造*/
    public BaseError(String msg) {
        this.code = 100;
        this.msg = msg;
    }

    /**成功*/
    public static final BaseError SUCCESS = new BaseError(200, "操作成功");
    /**权限异常*/
    public static final BaseError LOGIN_ERR = new BaseError(402, "登录失败");

    public static final BaseError USER_NOT_EXIST = new BaseError(1301, "账号不存在");
    public static final BaseError USERNAME_OR_PASSWORD_ERROR = new BaseError(1302, "账号或密码错误");
    public static final BaseError ACCOUNT_DISABLED = new BaseError(1303,"该账户已被禁用，请联系管理员");
    public static final BaseError ACCOUNT_LOCKED = new BaseError(1304,"该账号已被锁定，请联系管理员");
    public static final BaseError ACCOUNT_EXPIRED = new BaseError(1305,"该账号已过期，请联系管理员");
    public static final BaseError ACCOUNT_EXPIRED_LOCKED_EXPIRED = new BaseError(1306,"该账号异常，请联系管理员");
    public static final BaseError ACCOUNT_NOT_FOUND_ROLE = new BaseError(1307,"该账号未授权，请联系管理员");

    public static final BaseError ACCESS_UNAUTHORIZED = new BaseError(1401, "访问未授权");
    public static final BaseError TOKEN_INVALID_IS_BLANK = new BaseError(1402, "令牌不能为空");
    public static final BaseError TOKEN_INVALID_OR_EXPIRED = new BaseError(1403, "令牌无效或已过期");
    public static final BaseError CLIENT_AUTHENTICATION_FAILED = new BaseError(1404, "客户端认证失败");
    public static final BaseError TOKEN_ACCESS_FORBIDDEN = new BaseError(1405, "令牌已被禁止访问");

    /**系统异常*/
    public static final BaseError SYS_ERR = new BaseError(10000, "服务器异常");
    public static final BaseError PARAM_ERR = new BaseError(10001, "请求参数异常");

    /**限流降级熔断 */
    public static final BaseError REQ_FLOW_ERR = new BaseError(11000, "流控规则异常");
    public static final BaseError REQ_DEGRADE_ERR = new BaseError(11001, "降级规则异常");
    public static final BaseError REQ_PARAM_FLOW_ERR = new BaseError(11002, "热点规则异常");
    public static final BaseError REQ_AUTHORITY_ERR = new BaseError(11003, "授权规则异常");
    public static final BaseError REQ_SYSTEM_BLOCK_ERR = new BaseError(11004, "系统规则异常");


    /**三方异常*/
    public static final BaseError THIRD_ERR = new BaseError(20000, "调用三方支付失败");





}
